package org.swift.mashup.engine.model;

import java.io.IOException;
import java.io.OutputStream;

import org.swift.commons.xml.Match;

public class MatchActivityContext implements ActivityContext {

	private Match match;
	
	public MatchActivityContext(Match match) {
		this.match = match;
	}

	@Override
	public byte[] getBytes() throws IOException {
		return match.getValue().getBytes();
	}

	@Override
	public long getSize() {
		return match.getLength();
	}

	@Override
	public Object getValue() {
		return match;
	}

	@Override
	public void writeAll(OutputStream outputStream) throws IOException {
		outputStream.write(match.getValue().getBytes());		
	}

}
